﻿using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing.Design;
using System.Reflection;
using System.Windows.Forms.Design;

namespace N2.Explorer
{
	using ComponentModel.Design;
	
	[DefaultProperty("ConfigurationFile")]
	class SettingsFacade
	{
		#region Fields
		
		readonly SessionSettings m_settings;

		#endregion Fields

		#region ctor

		public SettingsFacade(SessionSettings settings)
		{
			this.m_settings = settings;
		}

		#endregion ctor

		#region Properties

		[Editor(typeof(FileNameEditor), typeof(UITypeEditor))]
		[Description("web.config file of an ASP.Net application where N2 is configured")]
		[Category("Configuration")]
		[DisplayName("Configuration File")]
		public string ConfigurationFile {
			get { return this.m_settings.ConfigurationFile; }
			set { this.m_settings.ConfigurationFile = value; }
		}
		
		[DisplayName("Web Application Root")]
		public string AppRoot {
			get { return this.m_settings.AppRoot; }
		}
		
		[Editor(typeof(AssemblyNameCollectionEditor), typeof(UITypeEditor))]
		[Category("Configuration")]
		[DisplayName("Assembly List")]
		[Description("List of assemblies to load")]
		public List<AssemblyName> AssemblyFileNameList {
			get { return this.m_settings.AssemblyNameList; }
		}

		#endregion Properties
	}
}
